{% comment %}
/* Copyright 2009 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
{% endcomment %}
{% spaceless %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <!-- powered by Cruise Control http://cruise-control.appspot.com -->
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="icon" href="/favicon.ico"/>
    <meta name="generator" content="Cruise Control for App Engine {{cc_version}}" />
    {% if keywords %}
    <meta name="keywords" content="{{keywords|escape}}" />
    {% endif %}
    {% if description %}
    <meta name="description" content="{{description|escape}}" />
    {% endif %}
    {% if noindex or noarchive or nofollow or nosnippet or noodp %}
    <meta name="robots" content="{% if noindex %}noindex,{% endif %}{%if nofollow %}nofollow,{% endif %}{% if nosnippet %}nosnippet,{% endif %}{% if noodp %}noodp{% endif %}" />
    {% endif %}
    {% if canonical %}
    <link rel="canonical" href="{{canonical|escape}}" />
    {% endif %}
    <link
      href="/templates/{{blog.template}}/css/default-style.css"
      rel="stylesheet"
      type="text/css" />
    <link rel="alternate" type="application/rss+xml" title="RSS" href="{% if blog.feed_path %}{{blog.feed_path}}{% else %}/sitemap.rss{% endif %}">
    <title>{{page_title}}</title>
  </head>
{% endspaceless %}
  <body>
    <div id="lshadow">&nbsp;</div>
    <div id="rshadow">&nbsp;</div>
    <div id="content">
      <div id="head">
        {% if blog.enable_comments %}
        <div id="user-tools">
        {% if user %}
          {{ user.gia.email }} |
        {% endif %}
        {% if user %}
          <a class="dbg-link" href={{logout_url}}>Logout</a>
        {% else %}
          <a class="dbg-link" href={{login_url}}>Login</a>
        {% endif %}
        </div>
        {% endif %}
        {% if blog.google_cse_box %}
        <div id="search-box">
        	{{blog.google_cse_box}}
        </div>
        {% endif %}
        {% if blog.logo_path %}
        <div id="blog-logo">
        <a href="/" class="no-dec">
          <img src="/images/{{blog.logo_path}}">
        </a>
        </div>
        {% else %}
        <div id="blog-info">
          <div id="app-name"><a href="/">{{blog.name}}</a></div>
          <div id="app-tagline">{{blog.tagline}}</div>
        </div>
        {% endif %}
      </div>
      <div id="nav">
        {% for page in published_pages %}
        <a href="/{{page.path}}">
          <div class="page
            {% ifequal requested_page page.path %} selected{% endifequal %}">
            <div>{{page.button_name}}</div>
          </div>
        </a>
        {% endfor %}
        <a href="/" class="no-dec">
          <div
            class="page{% ifequal requested_page '' %} selected{% endifequal %}">
            <div>{{blog.button_name}}</div>
          </div>
        </a>
        {% if is_admin %}
        <a href="/admin/posts" class="no-dec">
        <div class="page admin
          {% if is_admin_page %} selected{% endif %}">
          <div>Admin</div>
        </div>
        </a>
        {% endif %}
        &nbsp;
      </div>
      <div id="sidebar">{% include 'sidebar.html' %}</div>
      <div id="main">
        {% block content %}
          &nbsp;
        {% endblock %}
      </div>
      <div id="footer">
        &nbsp;<div id="footer-text">Powered By:
          <a href="http://www.cruisecontrolforappengine.com">
            Cruise Control
          </a> for
          <a href="http://appengine.google.com">AppEngine</a>
        </div>&nbsp;
      </div>
    </div>
    {% if blog.google_analytics_id %}
	<script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '{{blog.google_analytics_id}}']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
      })();
    </script>
    {% endif %}
  </body>
</html>